<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //数组元素排序
        //reverse()方法，颠倒数组元素位置，改变原数组返回新数组
        var arr1 = ['one','two','three','four'];
        arr1.reverse();
        console.log(arr1);
        //sort()方法，对数组元素进行排序，改变原数组返回新数组
        var arr2 = [14,23,2,8,7,16,9,32,18];
        arr2.sort();
        console.log(arr2);
    </script>
</head>
<body>
    
</body>
</html>